import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/back',

  },
  {
    path: '/Home',
    name: 'Home',
    component: () => import('../views/Home'),
    redirect:'/back',
    children:[
      {
        path: '/back',
        name: 'back',
        component: () => import('../views/Home/back')
      }, {
        path: '/goodsList',
        name: 'goodsList',
        component: () => import('../views/Home/goodsList')
      }, {
        path: '/photo',
        name: 'photo',
        component: () => import('../views/Home/photo')
      }, {
        path: '/deteil',
        name: 'deteil',
        component: () => import('../views/Home/deteil')
      },
    ]
  },
  {
    path: '/goods',
    name: 'goods',
    component: () => import('../views/goods')
  },
  {
    path: '/vip',
    name: 'vip',
    redirect:"/vipList",
    children:[
      {
        path: '/vipList',
        name: 'vipList',
        component: () => import('../views/vip/vipList')
      }, {
        path: '/vipRank',
        name: 'vipRank',
        component: () => import('../views/vip/vipRank')
      }
    ],
    component: () => import('../views/vip')
  },
  {
    path: '/order',
    name: 'order',
    component: () => import('../views/order')
  },
  {
    path: '/set',
    name: 'set',
    redirect:'/basics',
    component: () => import('../views/set'),
    children:[
      {
        path: '/deal',
        name: 'deal',
        component: () => import('../views/set/deal')
      }, {
        path: '/logistics',
        name: 'logistics',
        component: () => import('../views/set/logistics')
      }, {
        path: '/basics',
        name: 'basics',
        component: () => import('../views/set/basics')
      }, {
        path: '/Administrator',
        name: 'Administrator',
        component: () => import('../views/set/Administrator')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login')
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
